#include<iostream>
using namespace std;
int main()
{
	int a[]={1,2,3,4,5,6,7,8,9},n=9;
	int min,max,i,sum=0;
	double ave;
	min=a[0];
	max=a[0];
	for(i=0;i<n;i++)
	{
		if (min>a[i])
			min=a[i];
		if(max<a[i])
			max=a[i];
	}
	for(i=0;i<n;i++)
		sum+=a[i];
	ave=(sum-min-max)/(1.0*(n-2));
	cout<<ave; 
	return 0;
}
